package com.znufe.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.znufe.dao.UserDao;
import com.znufe.model.User;
import com.znufe.service.UserManage;

@Service("UserManage")
public class UserManageImpl implements UserManage {

	private UserDao userDao;
	
	@Resource(name = "UserDao")
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public void addUser(User user) {
		userDao.addUser(user);

	}

	public void delete(User user) {
		userDao.deleteUser(user);

	}

	public List<User> findAll() {
		return userDao.findAllUser();
	}

	public User findById(Integer id) {
		return userDao.findUserById(id);
	}

	public void update(User user) {
		userDao.updateUser(user);
	}

	@Override
	public User checkUser(User user) {
		return userDao.checkUser(user);
	}

}
